#ifndef GPT_API_H
#define GPT_API_H

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <curl/curl.h>
#include <cjson/cJSON.h>
#include <stdint.h>
#include <stdio.h>
#include <unistd.h>
#include <errno.h>

struct MemoryStruct {
  char *memory;
  size_t size;
};

typedef enum{
  PARAMETER_ERROR,
  FILE_NOT_FOUND,
  FEW_PARAMETERS,
  OPEN_FILE_ERROR,
  FILE_NULL,
  FILE_READ_ERROR,
  USER_TEXT_NULL,
  MODEL_ERROR,
  MaxLogId,
} logid;

static char* gpt_name[] = {"deepseek-v3-free", "GLM-4-Air", "qwen-coder-plus-latest"};

void process_event(const char *event_data);
size_t WriteCallback(void *contents, size_t size, size_t nmemb, void *userp);
void gpt_read_code(char* mode_name, char* require, char* text, uint8_t mode);
void mylog(int lognumber, char* argv[]);

#endif